<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 信息管理验证器
 */
class Message extends AdminBase
{
    
    // 验证规则
    protected $rule =   [
        
        'number'                        => 'require|number'
        'name'                          => 'require|unique:message',
        'sex'                           => 'require',
        'phone'                         => 'require|number',
        'address'                       => 'require',
        'dormitory'                     => 'require',
        'parent_phone'                  => 'require|number',

    ];

    // 验证提示
    protected $message  =   [
        
        'number.require'                            => '学号不能为空',
        'name.require'                              => '链接名称不能为空',
        'sex.require'                               => '性别不能为空',
        'phone.require'                             => '联系电话不能为空',
        'phone.number'                              => '联系电话必须为数字',
        'adress.require'                            => '家庭住址不能为空',
        'dormitory.require'                         => '宿舍号不能为空',
        'parent_phone.require'                      => '父（母）联系电话不能为空',
        'parent_phone.number'                       => '父（母）联系电话必须为数字',
    ];

    // 应用场景
    protected $scene = [
        
        'edit' =>  ['number','name','sex','phone','adress','dormitory','parent_phone'],
    ];
    
}
